#include <bits/stdc++.h>
using namespace std;
#define N 2000000
int s[N+1], n;
int main()
{
    cin>>n;
    for(int i = 1; i <= N; ++i)
        s[i] = i + s[i - 1];
    for(int i = 1; i < N; ++i)
        for(int j = i + 1; j <= N; ++j)
        {
            if(s[j] - s[i-1] == n)
                cout<<i<<' '<<j<<endl;
            else if(s[j] - s[i-1] > n)
                break;
        }
    return 0;
} 
